package inno.specificOperator;

import inno.data.MovingAvg;
import inno.data.MovingAvgSingelton;

public class MovingAvgOperator implements Operator{
	
	MovingAvg myMovingAvg;
	
	public MovingAvgOperator(String stockName){
		myMovingAvg = MovingAvgSingelton.getInstance().getStockMovingAvg(stockName);
	}
	
	// val1 is the day from which to take the avg
	// val2 is the desired bump
	public Double calculate(Double val1, Double val2){
		return myMovingAvg.getMvAvg(val1.intValue(), val2.intValue());
	}

	@Override
	public String getTag() {
		return "MAVG";
	}

}
